<style>
#result {
	height:20px;
	font-size:11px;
	font-family:Arial, Helvetica, sans-serif;
	color:#333;
	padding:5px;
	margin-bottom:60px;
	background-color:#9e1aaa;
}
.suggestionsBox {
	position: absolute;
	left: 0px;
	top:0px;
	margin: 30px 0px 0px 0px;
	width: 150px;
	padding:0px;
	background-color: #d065da;
	border-top: 3px solid #FFFFFF;
	color: #222;
	height: 20px;
}
.suggestionList {
	margin: 0px;
	padding: 5px;
	height: 20px;
}
.suggestionList ul li {
	list-style:none;
	margin: 0px;
	padding: 0px;
	border-bottom:1px dotted #666;
	cursor: pointer;
}
.suggestionList ul li:hover {
	background-color: #f29afa;
	color:#333;
}
ul {
	font-family:Arial, Helvetica, sans-serif;
	font-size:11px;
	color:#FFF;
	padding:0;
	margin:0;
}

.load{
background-image:url(images/loader.gif);
background-position:right;
background-repeat:no-repeat;
}

#suggest {
	position:relative;
	height: 20px;
}
#searchid {
	font-size:11px;
}
</style>
<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<body onLoad="MM_preloadImages('images/bc-upload-on.png')">
<h1>Profilo utente <?php echo $this->_username; ?></h1>
<?
$born_day = "";
$born_month = "";
$born_year = "";
if($this->_dt_nascita!=null)
{
	$born_day = substr($this->_dt_nascita, 8, 2);
	$born_month = substr($this->_dt_nascita, 5, 2);
	$born_year = substr($this->_dt_nascita, 0, 4);
	$dt_nascita_format = $born_day."/".$born_month."/".$born_year;
}
else
	$dt_nascita_format = "";
	
if($this->_dt_da_tour!=null)
{
	$born_day = substr($this->_dt_da_tour, 8, 2);
	$born_month = substr($this->_dt_da_tour, 5, 2);
	$born_year = substr($this->_dt_da_tour, 0, 4);
	$dt_da_tour_format = $born_day."/".$born_month."/".$born_year;
}
else
	$dt_da_tour_format = "";
	
if($this->_dt_a_tour!=null)
{
	$born_day = substr($this->_dt_a_tour, 8, 2);
	$born_month = substr($this->_dt_a_tour, 5, 2);
	$born_year = substr($this->_dt_a_tour, 0, 4);
	$dt_a_tour_format = $born_day."/".$born_month."/".$born_year;
}
else
	$dt_a_tour_format = "";
	
if($this->_name=="" || $dt_nascita_format=="00/00/0000" || $this->_id_citta==0 || $this->_id_citta=="" || $this->_sesso=="" || $this->_prefisso1=="" || $this->_telefono1=="" || $this->_annuncio=="" || $this->_f_attivo == "N")
{
	$sn_profilo_attivo = "N";
	$stato_profilo = "<font color='#FF0000' style='font-weight:bold'>PROFILO NON ATTIVO</font>";	
}
else
{
	$sn_profilo_attivo = "S";
	$stato_profilo = "<font color='#00CC00' style='font-weight:bold'>PROFILO ATTIVO</font>";
}

echo("<div align='right'>$stato_profilo</div>");
?>
<a name="tabs-3"></a>
<br>
<div id="tabs" style="font-size:115%;">
	<ul>
		<li><a href="#tabs-1">Dati personali</a></li>
	</ul>
    


	<div id="tabs-1" style="background:url(images/bggm.png) repeat-x bottom; font-size:11px;">
	<h1>Modifica dati personali</h1>
		
		<form action="profile_action.php" method="POST">
		
			<table width="96%" border="0" align="center" style="font-size:11px">
              <tr>
                <td>Nome:<br />
                  <input type="text" value="<?php echo $this->_name; ?>" name="name" class="input_form ui-corner-all" maxlength="20" style="background:url(images/element/bg-form-obbli.jpg) repeat-x #FFFFFF; color:#953585;"/></td>
                <td>Data nascita:<br /><input type="text" name="dt_nascita" id="datepicker" value="<?php echo $dt_nascita_format; ?>" maxlength="10" style="background:url(images/element/bg-form-obbli.jpg) repeat-x #FFFFFF; color:#953585;">
<!--<input type="text" value="<?php echo $born_day; ?>" name="born_day" class="input_form_dd ui-corner-all" maxlength="2"/>
/
<input type="text" value="<?php echo $born_month; ?>" name="born_month" class="input_form_mm ui-corner-all" maxlength="2"/>
/
<input type="text" value="<?php echo $born_year; ?>" name="born_year" class="input_form_yyyy ui-corner-all" maxlength="4"/>-->
&nbsp;</td>
                <td><br />Mostrare et&agrave;&nbsp;
                  <input type="checkbox" value="N" <?php echo ($this->_f_mostra_dt_nascita=="S"?"checked='checked'":""); ?> name="f_mostra_dt_nascita" /></td>
              </tr>
              <tr>
                <td>Etnia:<br />
                  <select name="id_nazionalita">
                    <?php
			$id_nazionalita_utente = $this->_id_nazionalita;
			$res = $this->ReadAllNationes();
			while ($row = mysql_fetch_array($res))
			{    
				$id_nazionalita = $row["id_nazionalita"];
				$nome = stripslashes($row["nome"]);                 
				?>
                    <option value="<?=$id_nazionalita?>" <?if($id_nazionalita == $id_nazionalita_utente){echo "selected";}?>>
                    <?=$nome?>
                    </option>
                    <?
			}
			mysql_free_result($res);
			$id_citta = $this->_id_citta;
			$nome_citta = $this->GetCittaById($id_citta);
			$id_citta_tour = $this->_id_citta_tour;
			$nome_citta_tour = $this->GetCittaById($id_citta_tour);
			
			?>
                  </select></td>
                <td><div id="suggest">Citt&agrave;:<br />
                      <input type="text" size="25" value="<?=$nome_citta?>" autocomplete="off" name="nome_citta" id="searchtext" onKeyUp="suggest(this.value);" onBlur="fill();" class="input_form ui-corner-all" style="background:url(images/element/bg-form-obbli.jpg) repeat-x #FFFFFF; color:#953585" />
                      <input type="text" value="<?=$id_citta?>" name="id_citta" id="searchid" size="3" />
                      <div class="suggestionsBox" id="suggestions" style="display:none ; height:20px">
                        <div class="suggestionList" id="suggestionsList"></div>
                      </div>
                </div></td>
                <td> Zona:<br />
<input type="text" value="<?php echo $this->_zona; ?>" name="zona" class="input_form ui-corner-all" maxlength="20" /></td>
              </tr>              
              <tr>
                <td colspan="3"><h3>Tour</h3></td>
              </tr>
              <tr>
                <td colspan="3">
                	<div id="suggest">Citt&agrave;:<br />
                      <input type="text" size="25" value="<?=$nome_citta_tour?>" autocomplete="off" name="nome_citta_tour" id="searchtext2" onKeyUp="suggest2(this.value);" onBlur="fill2();" class="input_form ui-corner-all" />
                      <input type="text" value="<?=$id_citta_tour?>" name="id_citta_tour" id="searchid2" size="3" />
                      <div class="suggestionsBox" id="suggestions2" style="display:none ; height:20px">
                        <div class="suggestionList" id="suggestionsList2"></div>
                      </div> dal <input type="text" name="dt_da_tour" id="datepicker2" value="<?php echo $dt_da_tour_format; ?>" maxlength="10"> al <input type="text" name="dt_a_tour" id="datepicker3" value="<?php echo $dt_a_tour_format; ?>" maxlength="10">
                </div>
                </td>
              </tr>

